package fr.esiag.isidis.pdsTeam.Gateway_Mock;

import java.awt.ScrollPane;

import javax.swing.DefaultListModel;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.ListModel;

public class MessageBoard extends JFrame{

	private DefaultListModel listModel ;
	private ScrollPane content;
	private JList list;
	
	public MessageBoard() {
		content=new ScrollPane();
		add(content);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setTitle("Messages board :");
		 list = new JList();
		 listModel = new DefaultListModel();
		 list.setModel(listModel);
		// setUndecorated(true);
		 getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
		 content.add(list);
		 add(content);
		 setSize(500,800);
		 setVisible(true);
	}
	
	public void AddMessage(String msg){
		listModel.addElement(msg);
	}
}
